using UnityEngine;

namespace CinemaDirector
{
	[CutsceneItem("Tween", "Position")]
	public class GGActorTweenPosition : CinemaActorAction
	{
		public Vector3 start;

		public Vector3 end;

		public override void Trigger(GameObject Actor)
		{
			Actor.transform.localPosition = start;
		}

		public override void UpdateTime(GameObject Actor, float runningTime, float deltaTime)
		{
			float t = runningTime / Mathf.Max(0.01f, base.Duration);
			Actor.transform.localPosition = Vector3.Lerp(start, end, t);
		}

		public override void End(GameObject Actor)
		{
			Actor.transform.localPosition = end;
		}
	}
}
